unit Unit6;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, unitSemaphoreLock, RibbonLunaStyleActnCtrls,
  Ribbon, ComCtrls;

type
  TForm6 = class(TForm)
    ListBox1: TListBox;
    Panel1: TPanel;
    btn2: TButton;
    Button1: TButton;
    btn1: TButton;
    Ribbon1: TRibbon;
    StatusBar1: TStatusBar;
    procedure btn1Click(Sender: TObject);
    procedure btn2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form6: TForm6;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm6.btn1Click(Sender: TObject);
begin
  Close;
end;

procedure TForm6.btn2Click(Sender: TObject);
var
  H1: THandle;
begin
  H1 := Lock('tgs_log');
  DeleteFile(Form1.EXEPath + '\log.txt');
  ListBox1.Items.Clear;
  UnLock(H1);
end;

procedure TForm6.Button1Click(Sender: TObject);
var
  H1: THandle;
begin
  H1 := Lock('tgs_log');
  ListBox1.Items.Clear;
  if FileExists(Form1.EXEPath + 'log.txt') then
    ListBox1.Items.LoadFromFile(Form1.EXEPath + 'log.txt');
  UnLock(H1);
end;

end.
